package com.xqiapp.jsp.config;

/**
 * Created by rwrwd7 on 2017/9/21.
 */
public class DataSourceRouteHolder {

    private static final ThreadLocal<String> dataSources = new ThreadLocal<>();

    public static void setDataSourceRouteKey(String routeKey) {
        dataSources.set(routeKey);
    }

    public static String getDataSourceRouteKey() {
        return dataSources.get();
    }

    public static void clearDataSourceRouteKey() {
        System.out.println("-----------------Removed data source key:"+getDataSourceRouteKey());
        dataSources.remove();
    }

}
